{% extends 'TopxiaWebBundle::layout.html.twig' %}

{% block title %}{{ '创建课程'|trans }} - {{ parent() }}{% endblock %}

{% set script_controller = 'course/create' %}

{% block content %}
    <div class="row">
        <div class="panel panel-default panel-page panel-create-course">
            <div class="panel-heading"><h2>{{ '创建课程'|trans }}</h2></div>

            {% if not app.user.largeAvatar or not app.user.title or not userProfile.about %}
                {% include 'TopxiaWebBundle:Settings:user-profile.html.twig' %}
            {% else %}
                <form id="course-create-form" class="form-horizontal" method="post">

                    {{ web_macro.flash_messages() }}

                    <div class="course-piece">
                        {{ '选择类型'|trans }}
                    </div>

                    <div class="row">
                        <div class="col-md-3">
                            <div class="course-select active" data-type="normal">
                                <i class="es-icon es-icon-putongkecheng "></i>
                                <div class="course-type">普通课程</div>
                                <div class="course-intro">支持视频、图文、PPT等各种形式，支持作业、笔记等多个学习工具的课程</div>
                            </div>
                        </div>

                        <div class="col-md-3">
                            {% if not setting('live-course.live_course_enabled') %}
                            <div class="course-select disabled" data-toggle="tooltip" data-placement="top"
                                 title="云直播开启后可用"
                                 data-type="live">
                                {% else %}
                                <div class="course-select" data-type="live">
                                    {% endif %}
                                    <i class="es-icon es-icon-zhibokecheng "></i>
                                    <div class="course-type">直播课程</div>
                                    <div class="course-intro">以直播为教学形式的，支持多个学习工具的课程</div>
                                </div>
                            </div>

                            <div class="col-md-3">
                                <div class="course-select " data-type="open">
                                    <i class="es-icon es-icon-lubogongkaike"></i>
                                    <div class="course-type">录播公开课</div>
                                    <div class="course-intro">免费、无门槛观看的视频课程，主要用于营销推广</div>
                                </div>
                            </div>

                            <div class="col-md-3">
                                {% if not setting('live-course.live_course_enabled') %}
                                <div class="course-select disabled" data-toggle="tooltip" data-placement="top"
                                     title="云直播开启后可用"
                                     data-type="liveOpen">
                                    {% else %}
                                    <div class="course-select" data-type="liveOpen">
                                        {% endif %}
                                        <i class="es-icon es-icon-zhibokecheng2"></i>
                                        <div class="course-type">直播公开课</div>
                                        <div class="course-intro">免费、无门槛参与的直播课程，主要用于营销推广</div>
                                    </div>
                                </div>
                            </div>

                            {% include 'OrgBundle:Org:course-create-org-tree-select.html.twig' %}

                            <div class="course-title row">
                                <div class="col-md-2 controls-label text-lg">
                                    <div class="course-piece title">
                                        {{ '课程标题'|trans }}
                                    </div>
                                </div>
                                <div class="col-md-10 controls">
                                    <input type="text" id="course_title" name="title" required="required"
                                           class="form-control"
                                           data-widget-cid="widget-1" data-explain="">
                                    <div class="help-block" style="display:none;"></div>
                                </div>
                            </div>

                            <div class="text-center">
                                {% if not setting('copyright.owned') %}
                                    <span class="mrm"><a href="http://www.qiqiuyu.com/course/22" class="text-muted"
                                                         target="_blank">{{ '如何创建课程？'|trans }}</a></span>
                                {% endif %}
                                <input id="course-create-btn" data-submiting-text="{{ '正在创建'|trans }}"
                                       class="btn btn-fat btn-primary"
                                       type="submit" value="{{ '创建'|trans }}">
                                <a class="btn btn-fat btn-link"
                                   href="{{ app.request.headers.get('Referer') }}">取消</a>
                            </div>

                            <input type="hidden" name="type" value="normal"/>
                            <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
                        </div>
                    </div>
                </form>

            {% endif %}
        </div>
    </div>
{% endblock %}